'use strict';

const Controller = require('egg').Controller;

class ResourceController extends Controller {
    async list() {
        let {ctx,service} = this;
        //uid
        let {uid} = ctx.info;

        if(uid){
            //1.根据uid去用户角色表里查对应的rid
            let list = await service.resource.list(uid);
            ctx.body = {
                code:1,
                data:list
            }
        }else{
            ctx.body = {
                code:2,
                msg:'参数有误'
            }
        }
    }
}

module.exports = ResourceController;
